home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / hips / sources / scale_geom / scanline.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-17  |  1.4 KB  |  51 lines

  1. /* scanline.h: definitions for generic scanline data type and routines */
  2.  
  3. #ifndef SCANLINE_HDR
  4. #define SCANLINE_HDR
  5.  
  6. /* $Header: scanline.h,v 3.0 88/10/10 13:52:04 ph Locked $ */
  7.  
  8. #include "pixel.h"
  9.  
  10. /* scanline type is composed of #bytes per channel and #channels */
  11.  
  12. /* alternatives for number of bytes per channel */
  13. #define PIXEL_BYTESMASK 3
  14. #define PIXEL1 0
  15. #define PIXEL2 1
  16. #define PIXEL4 2
  17.  
  18. /* alternatives for number of channels per pixel */
  19. #define PIXEL_CHANMASK 4
  20. #define PIXEL_MONO 0
  21. #define PIXEL_RGB  4
  22.  
  23. /*
  24.  * for 1-byte rgb we use Pixel1_rgba, not Pixel1_rgb, since some compilers
  25.  * (e.g. mips) don't pad 3-byte structures to 4 bytes as most compilers do
  26.  */
  27. typedef Pixel1_rgba Scanline_rgb1;
  28. typedef Pixel2_rgba Scanline_rgb2;
  29. typedef Pixel4_rgb  Scanline_rgb4;
  30.  
  31. typedef struct {        /* GENERIC SCANLINE */
  32.     int type;            /* scanline type: #bytes ored with #channels */
  33.     int len;            /* length of row array */
  34.     int y;            /* y coordinate of this scanline (if we care) */
  35.     union {            /* one of the following is valid dep. on type */
  36.     Pixel1     *row1;
  37.     Pixel2     *row2;
  38.     Pixel4     *row4;
  39.     } u;
  40. } Scanline;
  41.  
  42. typedef struct {        /* SAMPLED FILTER WEIGHT TABLE */
  43.     short i0, i1;        /* range of samples is [i0..i1-1] */
  44.     short *weight;        /* weight[i] goes with pixel at i0+i */
  45. } Weighttab;
  46.  
  47. #define CHANBITS 8        /* # bits per image channel */
  48. #define CHANWHITE 255        /* pixel value of white */
  49.  
  50. #endif
  51.